<!DOCTYPE html>
<html  lang="en" xmlns:th="http://www.thymeleaf.org"> <!--注意要加文件头-->
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link th:href="@{/css/page.css}" rel="stylesheet" type="text/css" />
</head>
<body>
<center>
    <table border="2">
      <tr>
        <td>id</td>
        <td>名字</td>
        <td>雌雄</td>
        <td>颜色</td>
        <td>单位</td>
        <td>出生日期</td>
        <td>操作</td>
      </tr>



        <tr th:each="list:${p.list}">
        <td th:text="${list.id}"></td>
        <td th:text="${list.name}"></td>

        <td th:switch="${list.gender}">
            <span th:case="1">男</span>
            <span th:case="2">女</span>
        </td>

        <td th:text="${list.color}"></td>
        <td th:text="${list.danw}"></td>

        <td th:text="${#dates.format(list.birthday,'yyyy-MM-dd')}"></td>
            <td>
                <a th:href="@{/delete(id=${list.id})}">删除</a>
                <a th:href="@{/updateById(id=${list.id})}">修改</a>
            </td>



    </tr>
    </table>
</center>


    <div class="left">
        <form action="/findAll" style="text-align: center;" method="post" >
            <ul class="pagination">
                <li ><a  href="/findAll?pageNum=1">首页</a></li>
                <span th:if="${p.pageNum>1}"><li><a th:href="@{/findAll(pageNum=${p.pageNum}-1)}">上一页</a></li></span>

                <span  test="${p.pageNum<p.pages}">
                    <li ><a href="/findAll?pageNum=2">下一页</a></li>
                </span>

                <li ><a th:href="@{/findAll(pageNum=${p.pages})}">末页</a></li>
                <li><a  th:text="${p.pages}"></a></li>
                <li><a >跳到<input type="text" name="pageNum" style="width: 20px; height: 20px">页</a></li>
                <li><a><input type="submit" value="GO" /></a></li>
            </ul>
        </form>
    </div>




</body>
</html>